//管理员状态机
const axios = require('axios')
module.exports = {
    namespaced: true,
    state: {
        nuer: [],
        several: 4,
        yeshu: 1,
        pages: '',
        rowss: '',
        lei: '',
        leirong: '',
    },
    mutations: {
        getadmin(state, data) {
            state.nuer = data
        }
    },
    actions: {
        getadminacti(context) {
            axios.get('/admier/Adminer').then(({ data }) => {
                context.commit("getadmin", data)
            })
        },
        //增加
        async addadminacti(context, data1) {
            var { data } = await axios.post('/admier/addadmin', data1)
            return data
        },
        //删除
        dilet(context,data){
            axios.get('/admier/dilet',{ params: { _id: data } })
        },
        //显示修改数据
       async xian(context,data1){
        var {data}= await axios.get('/admier/gai',{params: { _id: data1 }})
        return data
        },
        //修改数据
        submitadminer(context,data){
            axios.post('/admier/submitadminer',{data})
        }
    }
}